<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">

	<rich:modalPanel id="editNatPersonDlg" minWidth="550" minHeight="420" zindex="15500">
		<f:facet name="header">
			<h:outputText value="Agregar Persona Natural" />
		</f:facet>

		<f:facet name="controls">
			<h:panelGroup>
				<h:graphicImage id="hideEditNatPersonDlg" value="/img/close.png"
					styleClass="hidelink" />
				<rich:componentControl for="editNatPersonDlg"
					attachTo="hideEditNatPersonDlg" operation="hide" event="onclick" />
			</h:panelGroup>
		</f:facet>

		<h:form id="frmEditNatPerson">
			<h:panelGroup rendered="#{personHelper.selected != null}">
				<h:panelGrid columns="4" width="100%">
					<h:outputText value="No. de Identidad: " />
					<h:inputText value="#{personHelper.selected.identity}"
						readonly="#{not personHelper.editing}" required="true"
						label="button.ok">
					</h:inputText>

					<h:outputText value="RTN: " />
					<h:inputText value="#{personHelper.selected.rtn}" readonly="#{not personHelper.editing}" />

					<h:outputText value="Primer Apellido: " />
					<h:inputText value="#{personHelper.selected.lastName1}" readonly="#{not personHelper.editing}" />

					<h:outputText value="Segundo Apellido: " />
					<h:inputText value="#{personHelper.selected.lastName2}" readonly="#{not personHelper.editing}" />

					<h:outputText value="Primer Nombre: " />
					<h:inputText value="#{personHelper.selected.firstName1}" readonly="#{not personHelper.editing}" />

					<h:outputText value="Segundo Nombre: " />
					<h:inputText value="#{personHelper.selected.firstName2}" readonly="#{not personHelper.editing}" />

					<h:outputText value="Fecha de Nacimiento: " />
					<rich:calendar value="#{personHelper.selected.dob}" readonly="#{not personHelper.editing}" />

					<h:outputText value="Sexo: " />
					<h:inputText value="#{personHelper.selected.gender}" readonly="#{not personHelper.editing}"/>

					<h:outputText value="Nacionalidad: " />
					<h:inputText value="#{personHelper.selected.nationality}" readonly="#{not personHelper.editing}"/>

					<h:outputText value="Estado civil: " />
					<h:inputText value="#{personHelper.selected.maritalStatus}" readonly="#{not personHelper.editing}"/>
				</h:panelGrid>
				<br />
				<h:panelGrid columns="1" width="100%">
					<h:outputText value="Direccion: " />
					<h:inputTextarea
						value="#{personHelper.selected.addressDescription}"
						readonly="#{not personHelper.editing}"
						style="width:100%" rows="5">
					</h:inputTextarea>
				</h:panelGrid>
				<br />
				<h:panelGrid columns="4" width="100%">
					<h:outputText value="Telefono(s): " />
					<h:inputText
						value="#{personHelper.selected.phones}"
						readonly="#{not personHelper.editing}">
					</h:inputText>

					<h:outputText value="email(s): " />
					<h:inputText
						value="#{personHelper.selected.emails}"
						readonly="#{not personHelper.editing}">
					</h:inputText>
				</h:panelGrid>
			</h:panelGroup>

			<br />
			<br />
			<br />

			<div align="center">
				<h:panelGroup rendered="#{personHelper.editing}">
					<a4j:commandButton value="#{messages['button.ok']}"
						action="#{personHelper.saveSelected}"
						reRender="frmNatPersonGrid"
						oncomplete="if (#{facesContext.maximumSeverity == null}) #{rich:component('editNatPersonDlg')}.hide(); else #{rich:component('msgPanel')}.show();">
					</a4j:commandButton>
					<button
						onclick="#{rich:component('editNatPersonDlg')}.hide();"
						type="button">
						#{messages['button.cancel']}
					</button>
				</h:panelGroup>
				<h:panelGroup rendered="#{not personHelper.editing}">
					<button
						onclick="#{rich:component('editNatPersonDlg')}.hide();"
						type="button">
						#{messages['button.ok']}
					</button>
				</h:panelGroup>
			</div>
		</h:form>
	</rich:modalPanel>

</ui:composition>
